﻿using System;
using System.Runtime.InteropServices.ComTypes;
using System.Runtime.InteropServices;

namespace SilverlightViewport.Common.Interop
{
    [ComImport, ComConversionLoss, Guid("00000112-0000-0000-C000-000000000046"), InterfaceType((short)1)]
    public interface IOleObject
    {
        [PreserveSig]
        int SetClientSite([In, MarshalAs(UnmanagedType.Interface)] IOleClientSite pClientSite);
        [PreserveSig]
        int GetClientSite([MarshalAs(UnmanagedType.Interface)] out IOleClientSite ppClientSite);
        [PreserveSig]
        int SetHostNames([In, MarshalAs(UnmanagedType.LPWStr)] string szContainerApp, [In, MarshalAs(UnmanagedType.LPWStr)] string szContainerObj);
        [PreserveSig]
        int Close([In] uint dwSaveOption);
        [PreserveSig]
        int SetMoniker([In] uint dwWhichMoniker, [In, MarshalAs(UnmanagedType.Interface)] IMoniker pmk);
        [PreserveSig]
        int GetMoniker([In] uint dwAssign, [In] uint dwWhichMoniker, [MarshalAs(UnmanagedType.Interface)] out IMoniker ppmk);
        [PreserveSig]
        int InitFromData([In, MarshalAs(UnmanagedType.Interface)] IDataObject pDataObject, [In] int fCreation, [In] uint dwReserved);
        [PreserveSig]
        int GetClipboardData([In] uint dwReserved, [MarshalAs(UnmanagedType.Interface)] out IDataObject ppDataObject);
        [PreserveSig]
        int DoVerb([In] int iVerb, [In, MarshalAs(UnmanagedType.Struct)]ref MSG lpmsg, [In, MarshalAs(UnmanagedType.Interface)] IOleClientSite pActiveSite, [In] int lindex, [In] IntPtr hWndParent, [In, MarshalAs(UnmanagedType.Struct)]ref RECT lprcPosRect);
        [PreserveSig]
        int EnumVerbs([MarshalAs(UnmanagedType.Interface)] out IEnumOLEVERB ppEnumOleVerb);
        [PreserveSig]
        int Update();
        [PreserveSig]
        int IsUpToDate();
        [PreserveSig]
        int GetUserClassID(out Guid pClsid);
        [PreserveSig]
        int GetUserType([In] uint dwFormOfType, [In] IntPtr pszUserType);
        [PreserveSig]
        int SetExtent([In] uint dwDrawAspect, [In, MarshalAs(UnmanagedType.LPArray)] SIZEL[] pSizel);
        [PreserveSig]
        int GetExtent([In] uint dwDrawAspect, [Out, MarshalAs(UnmanagedType.LPArray)] SIZEL[] pSizel);
        [PreserveSig]
        int Advise([In, MarshalAs(UnmanagedType.Interface)] IAdviseSink pAdvSink, out uint pdwConnection);
        [PreserveSig]
        int Unadvise([In] uint dwConnection);
        [PreserveSig]
        int EnumAdvise([MarshalAs(UnmanagedType.Interface)] out IEnumSTATDATA ppenumAdvise);
        [PreserveSig]
        int GetMiscStatus([In] uint dwAspect, out uint pdwStatus);
        [PreserveSig]
        int SetColorScheme([In, MarshalAs(UnmanagedType.LPArray)] LOGPALETTE[] pLogpal);
    }
}
